const mongoose = require('mongoose')

const userSchema = new mongoose.Schema({
    username:{
        type:String,
        required:true,
        minlength:3,
    },
    password:{
        type:String,
        required:true,
        match:/[a-zA-Z0-9_]{3,16}/
    },
    nickname: {
        type: String,
        required: true,
        minlength:1
    }
},{timestamps:true})

mongoose.model('User',userSchema,'user')